import os
base_dir = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = 'GFGFGFDGDF'
import datetime
class BasicConfig(object):
    SECRET_KEY = '213FDSFSD'

class DevelopmentConfig(BasicConfig):
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:12345678@127.0.0.1:3306/myshop?charset=utf8mb4'
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    SQLALCHEMY_RECORD_QUERIES = True
    SQLALCHEMY_ENGINE_OPTIONS = {
        'pool_size': 5,
        'pool_timeout': 90,
        'pool_recycle': 7200,
        'max_overflow': 1024
    }
    SQLALCHEMY_ECHO = False  # 打印SQL

    # 富文本编辑器设置
    CKEDITOR_SERVE_LOCAL = True
    CKEDITOR_HEIGHT = 400
    UPLOADED_PATH = os.path.join(base_dir, r'media/')
    CKEDITOR_FILE_UPLOADER = 'goods.upload'

    # 邮箱配置
    MAIL_SERVER = 'smtp.163.com'
    MAIL_USE_SSL = True
    MAIL_PORT = 465
    MAIL_USERNAME = 'zxh20210o@163.com'
    MAIL_PASSWORD = 'LPqgUekGXKiW9GKV'
    MAIL_DEFAULT_SENDER = 'zxh20210o@163.com'

    # 缓存配置
    CACHE_TYPE = 'redis'
    CACHE_REDIS_URL = 'redis://127.0.0.1:6379/5'

